// logs.js
const util = require('../../utils/util.js')

import Notify from '../../miniprogram_npm/@vant/weapp/notify/notify';
Page({
  data: {
    logs: [],
    fileList:[],
    locationName:"",

  },
  onLoad() {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return {
          date: util.formatTime(new Date(log)),
          timeStamp: log
        }
      })
    })
  },

  getLocation(){
    let _that = this;
    wx.chooseLocation({
      success: function (res) {
         console.log(res); 
         _that.setData({
           locationName:res.address
         })
       },
       fail: function () {
       },
       complete: function () {
       }
   })
  },


  submit(){
    if( this.data.locationName == "" || !this.data.fileList.length ){
      return Notify({ type: 'danger', message: '通知内容' });
    }
  },
  afterRead(data){
    console.log(data);
  }
})
